import axios from 'axios'

// 创建axios实例

const instance = axios.create({
    // 请求超时时间
    baseURL: 'http://localhost:8080/',
    timeout: 3000
})

// 请求拦截器

instance.interceptors.request.use(
    config => {
        return config
    },
    error => {
        console.log(error)
    }
)


// 响应拦截器
instance.interceptors.response.use(
    response => {
        const res = {}
        res.status = response.status
        console.log('res', res)
        return res
    },
    error => {
        console.log(error)
    }
)

export default instance